Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab unavailable
authorSimon McVittie <smcv@debian.org>
Thu, 31 Mar 2016 12:44:27 +0000 (13:44 +0100)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Thu, 31 Mar 2016 14:22:06 +0000 (14:22 +0000)
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters

tests/libtest.sh
tests/test-demo-buildsystem.sh
tests/test-rofiles-fuse.sh

index 21de2e870d05fa963f3c9c8017736e3886e92db9..3e4c4bd6d4b4737906df2289a3c8127809fd75e5 100755 (executable)
@@ -332,3 +332,20 @@ skip_without_user_xattrs () {
         exit 0
     fi
 }
+
+skip_without_fuse () {
+    if ! fusermount --version >/dev/null 2>&1; then
+        echo "1..0 # SKIP no fusermount"
+        exit 0
+    fi
+
+    if ! [ -w /dev/fuse ]; then
+        echo "1..0 # SKIP no write access to /dev/fuse"
+        exit 0
+    fi
+
+    if ! [ -e /etc/mtab ]; then
+        echo "1..0 # SKIP no /etc/mtab"
+        exit 0
+    fi
+}
index bffa59c4382e6e44c6bc46d2d55c54415ebc0474..97915f947b9781bc6eeb29266827fac22d5a7449 100755 (executable)
 
 set -euo pipefail
 
-if ! fusermount --version >/dev/null 2>&1; then
-    echo "1..0 # SKIP no fusermount"
-    exit 0
-fi
-
 . $(dirname $0)/libtest.sh
 
+skip_without_fuse
 skip_without_user_xattrs
 
 echo "1..1"
index ba45959e0a23d4077fbd1420f4976e7fe6db97be..d021df0980bfdc1b50505790b7f2c727d5e542a8 100755 (executable)
 
 set -euo pipefail
 
-if ! fusermount --version >/dev/null 2>&1; then
-    echo "1..0 # SKIP no fusermount"
-    exit 0
-fi
-
 . $(dirname $0)/libtest.sh
 
+skip_without_fuse
 skip_without_user_xattrs
 
 setup_test_repository "bare-user"